home *** CD-ROM | disk | FTP | other *** search
-
- ******************************************************************************
- * *
- * HodgePodge: An example Apple IIGS Desktop application *
- * *
- * Written in 65816 Assembler by the Apple IIGS Tools Team *
- * Modified by Ben Koning for "Programmer's Introduction to the Apple IIGS" *
- * *
- * Copyright (c) 1986-87 by Apple Computer, Inc. *
- * *
- * ---------------------------------------------------------------------- *
- * *
- * ASM65816 Code file "GLOBALS.ASM" -- Global variables and misc. routines *
- * *
- ******************************************************************************
-
-
-
- ****************************************************************
- *
- * GlobalDATA
- *
- ****************************************************************
- GlobalData DATA
-
-
- Prompt dc i1'19',c'Load which Picture:'
- Prompt2 dc i1'19',c'Save which Picture:'
- Wxoffset dc i'20' ; offset for upperleft window corner
- Wyoffset dc i'12' ; offset for upperleft window corner
-
- nullRect dc i'0,0,0,0'
-
- reply anop ;SF GET/PUT FILE record
- r_good dc i2'0'
- r_type dc i2'0'
- r_auxtyp dc i2'0'
- r_fname ds 16
- r_fullpn ds 128
-
- QuitParams dc i4'0'
- dc i'$4000' ; am restartable in memory
-
-
- ; ToolTable dc i'11'
- ; dc i'4,$0101' ; quickdraw
- ; dc i'5,$0100' ; desk manager
- ; dc i'6,$0100' ; event manager
- ; dc i'14,$0103' ; window manager from disk!
- ; dc i'15,$0103' ; menu manager from Disk!
- ; dc i'16,$0103' ; control manager form disk!
- ; dc i'20,$0100' ; line edit
- ; dc i'21,$0100' ; dialog manager from disk!
- ; dc i'23,$0100' ; standard files from disk!
- ; dc i'27,$0100' ; Font manager
- ; dc i'28,$0000' ; List manager
-
- ; ThisMode dc i'$0080' ;init mode: 640
-
- Srcinfo320 dc i'$00' ;PPtoPort 320 parms
- PicPtr320 ds 4
- dc i'160'
- dc i'0,0,200,320'
-
- SrcRect320 dc i'0,0,200,320'
-
- SrcLocInfo dc i'$80' ;PPtoPort 640 parms
- PicPtr ds 4
- dc i'160'
- dc i'0,0,200,640'
-
- SrcRect dc i'0,0,200,640'
-
- EventRecord anop
- EventWhat ds 2
- EventMessage ds 4
- EventWhen ds 4
- EventWhere ds 4
- EventModifiers ds 2
-
- TaskDATA ds 4
- TaskMask dc i4'$0FFF'
-
- QuitFlag ds 2
- DialogPtr ds 4
- Windex ds 2 ;Index to next avail.window ID
- LastWind gequ 15 ;Maximum number of windows open
- MyZP ds 2
- ; ZpHandle ds 4
- ; MyID ds 2
-
- Vindex ds 2 ;index used to list of what WAS visible
- Vtable ds 16*4 ;list of what WAS vis. when Hiding all
- WindowList ds 16*4 ;all windows handle go into this list
- WhichWindow ds 4 ;will contain window pointer, cur. window
- TempHandle ds 4 ;some temp handles
- Temp2Handle ds 4
- PicHandle ds 4 ; handle to picture data
- ;OrigPort ds 4
- SaveType ds 2
- ActivateFlag ds 2 ;flag for check front window.
- NeedToUpdate ds 2 ;used to prevent multi menu redraws
- ThisWType ds 2
- LastWtype ds 2
- PrintAvail dc i'0' ;Make sure this starts as 0
-
- PrintRecord ds 4 ; handle to print record
- PrintPort ds 4 ; pointer to printing GrafPort.
-
-
-
- VolNotFound gequ $45 ; prodos error
-
-
- ;------------------------------------------------------------
- ;
- ; MyWindowInfo
- ;
- ; This is the data structure used for the windows we
- ; allocate.
- ;
- MaxNameSize equ 29 ; largest name we allow
-
- oHandle equ 0
- oBlank equ oHandle+4
- oLength equ oBlank+1
- oName equ oLength+1
- oMMStuff equ oName+MaxNameSize
- oFlag equ oMMStuff+6
- oExtra equ oFlag+1
- ;
- oFontID equ oHandle ; if the type is for font,
- ; ; the first field is a FontID
- ; ; rather than the handle to picture
- ; ; data.
-
- MyWinfoSize equ oExtra+4
-
- END
-
- ****************************************************************
- *
- * IOData
- *
- ****************************************************************
- IOData DATA
-
- CreateParms anop
- NameC dc i4'0'
- dc i2'$00C3' ; DRNWR
- CType dc i2'$0006' ; BIN
- CAux dc i4'$00000000' ; Aux.
- dc i2'$0001' ; type
- dc i2'$0000' ; create date
- dc i2'$0000' ; create time
-
- DestParams anop
- NameD dc i4'0'
-
- OpenParams anop
- OpenID ds 2
- NamePtr ds 4
- ds 4
-
- ReadParams anop
- ReadID ds 2
- PicDestIN ds 4
- dc i4'$8000' ; this many bytes
- ds 4 ; how many xfered
-
- PReadParams anop ; for reading a packed file
- PReadID ds 2
- PReadLoc ds 4
- PReadSize ds 4 ; this many bytes
- ds 4 ; how many xfered
-
- MarkParams anop
- MarkID ds 2
- CurrentMark anop
- Mark ds 4
-
- WriteParams anop
- WriteID ds 2
- PicDestOUT ds 4
- dc i4'$8000' ; this many bytes
- ds 4 ; how many xfered
-
- PackWParams anop
- PackWID ds 2
- PackWDest ds 4
- HowMany ds 4 ; this many bytes
- ds 4 ; how many xfered
-
- CloseParams anop
- CloseID ds 2
-
- END
-
-
-
- ****************************************************************
- *
- * Ignore
- *
- * Does not do a whole lot.
- *
- ****************************************************************
- Ignore START
- rts
- END
-
- ****************************************************************
- *
- * Deref
- *
- * Derefs and locks the handle passed in a,x. Result passed back
- * in a,x. Trashes 0 on zp.
- *
- ****************************************************************
- Deref START
- sta 0
- stx 2
- ldy #4
- lda [0],y
- ora #$8000
- sta [0],y
- dey
- dey
- lda [0],y
- tax
- lda [0]
- rts
-
- END
-
-
- ****************************************************************
- *
- * Unlock
- *
- * Unlocks the handle passed in x and a. 0 is trashed on zp.
- *
- ****************************************************************
- Unlock START
-
- sta 0
- stx 2
- ldy #4
- lda [0],y
- and #$7FFF
- sta [0],y
- rts
-
- END
-